﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 供应商表基础输入参数
/// </summary>
public class SupplierBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 供应商名称
    /// </summary>
    [Required(ErrorMessage = "供应商名称不能为空")]
    public virtual string? SupplierName { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    [Required(ErrorMessage = "联系方式不能为空")]
    public virtual string? Contact { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public virtual int? SupplierStatus { get; set; }
    
    /// <summary>
    /// 审核日期
    /// </summary>
    [Required(ErrorMessage = "审核日期不能为空")]
    public virtual DateTime? AuditDate { get; set; }
    
}

/// <summary>
/// 供应商表分页查询输入参数
/// </summary>
public class PageSupplierInput : BasePageInput
{
    /// <summary>
    /// 供应商名称
    /// </summary>
    public string? SupplierName { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    public bool? SupplierStatus { get; set; }
    
    /// <summary>
    /// 审核日期范围
    /// </summary>
     public DateTime?[] AuditDateRange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 供应商表增加输入参数
/// </summary>
public class AddSupplierInput
{
    /// <summary>
    /// 供应商名称
    /// </summary>
    [Required(ErrorMessage = "供应商名称不能为空")]
    [MaxLength(50, ErrorMessage = "供应商名称字符长度不能超过50")]
    public string? SupplierName { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    [Required(ErrorMessage = "联系方式不能为空")]
    [MaxLength(32, ErrorMessage = "联系方式字符长度不能超过32")]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public bool? SupplierStatus { get; set; }
    
    /// <summary>
    /// 审核日期
    /// </summary>
    [Required(ErrorMessage = "审核日期不能为空")]
    public DateTime? AuditDate { get; set; }
    
}

/// <summary>
/// 供应商表删除输入参数
/// </summary>
public class DeleteSupplierInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 供应商表更新输入参数
/// </summary>
public class UpdateSupplierInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 供应商名称
    /// </summary>    
    [Required(ErrorMessage = "供应商名称不能为空")]
    [MaxLength(50, ErrorMessage = "供应商名称字符长度不能超过50")]
    public string? SupplierName { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>    
    [Required(ErrorMessage = "联系方式不能为空")]
    [MaxLength(32, ErrorMessage = "联系方式字符长度不能超过32")]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>    
    [Required(ErrorMessage = "状态不能为空")]
    public bool? SupplierStatus { get; set; }
    
    /// <summary>
    /// 审核日期
    /// </summary>    
    [Required(ErrorMessage = "审核日期不能为空")]
    public DateTime? AuditDate { get; set; }
    
}

/// <summary>
/// 供应商表主键查询输入参数
/// </summary>
public class QueryByIdSupplierInput : DeleteSupplierInput
{
}

/// <summary>
/// 供应商表数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportSupplierInput : BaseImportInput
{
    /// <summary>
    /// 供应商名称
    /// </summary>
    [ImporterHeader(Name = "*供应商名称")]
    [ExporterHeader("*供应商名称", Format = "", Width = 25, IsBold = true)]
    public string? SupplierName { get; set; }
    
    /// <summary>
    /// 联系方式
    /// </summary>
    [ImporterHeader(Name = "*联系方式")]
    [ExporterHeader("*联系方式", Format = "", Width = 25, IsBold = true)]
    public string? Contact { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [ImporterHeader(Name = "*状态")]
    [ExporterHeader("*状态", Format = "", Width = 25, IsBold = true)]
    public bool? SupplierStatus { get; set; }
    
    /// <summary>
    /// 审核日期
    /// </summary>
    [ImporterHeader(Name = "*审核日期")]
    [ExporterHeader("*审核日期", Format = "", Width = 25, IsBold = true)]
    public DateTime? AuditDate { get; set; }
    
}
